// EncryptFacade.java  
public class EncryptFacade {
    private FileReader fileReader;
    private CipherMachine cipherMachine;
    private FileWriter fileWriter;

    public EncryptFacade(FileReader fileReader, CipherMachine cipherMachine, FileWriter fileWriter) {
        this.fileReader = fileReader;
        this.cipherMachine = cipherMachine;
        this.fileWriter = fileWriter;
    }

    public void encryptAndWriteFile(String inputFilePath, String outputFilePath, int key) throws Exception {
        byte[] data = fileReader.readFile(inputFilePath);
        byte[] encryptedData = cipherMachine.encrypt(data, key);
        fileWriter.writeFile(encryptedData, outputFilePath);
    }
}